<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2019/11/14
 * Time: 10:19
 */

namespace DuRequest\Checker\lib\base;


interface RuleInterface
{

    /**
     * @param $rule array  the checker's rule
     * @return boolean
     */
    public function setRule( $rule );

    /**
     * @return boolean run the rule and return true|false
     */
    public function run();

    /**
     * @todo
     * @return array $errors get errors from validate example:[['key'=>$request_key,'msg'=>$error_msg]]
     */
    public function getErrors();

    /**
     * @return array $err the first error from validate example:['key'=>$request_key,'msg'=>$error_msg]
     */
    public function getFirstError();
}